export default {
    state: {
        name: 'zhangsan'
    },
    mutations: {
        upName(state, newName) {
            state.name = newName;
        }
    },
    actions: {
        asyncUpdateName(context, newName) {
            setTimeout(() => {
                context.commit('upName', newName);
            }, 2000);
        }
    },
    getters: {
        updateName(state, getters, rootState) {
            return state.name + rootState.count;
        }
    }

}